package top.wfzzq.dp.prototype;

/**
 * 原型
 * 
 * @author wanghui
 *
 */
public class MyPrototype {
	private int pid;
	private String info;

	public MyPrototype() {
	}
	public MyPrototype(int pid,String info) {
		this.pid = pid;
		this.info = info;
	}
	/**
	 * 創建一個自己的副本,自己就是原型模式
	 * @return
	 */
	public MyPrototype copyMe() {
		MyPrototype prototype=new MyPrototype();
		prototype.setPid(pid);
		prototype.setInfo(info);
		return prototype;
	}
	public int getPid() {
		return pid;
		
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	@Override
	public String toString() {
		return "MyPrototype [pid=" + pid + ", info=" + info + "]";
	}

}
